<template>
  <div class="hourly">
    <el-table :data="tableData" border style="width: 100%">
      <el-table-column prop="id" align="center" label="订单号" />
      <el-table-column prop="time" align="center" label="下单时间" />
      <el-table-column prop="user" align="center" label="下单用户" />
      <el-table-column prop="phone" align="center" label="联系方式" />
      <el-table-column prop="area" align="center" width="250" label="上门地址" />
      <el-table-column prop="time2" align="center" label="上门时间" />
      <el-table-column prop="goodType" align="center" label="小时单价" />
      <el-table-column prop="long" align="center" label="服务时长" />
      <el-table-column prop="couent" align="center" label="服务内容" />
      <el-table-column prop="money" align="center" label="金额" />
      <el-table-column prop="state" align="center" label="订单状态" />
      <el-table-column align="center" label="接单人">
        <template slot-scope="scope">
          <span v-show="scope.row.state==='待接单'? false: true">{{ scope.row.user2 }}</span>
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页 -->
    <el-col :span="24" class="toolbar" style="text-align: center;">
      <el-pagination
        background
        :current-page="currentPage"
        :page-count="pageNum"
        :page-size="pagesize"
        style="margin-top:30px;margin-bottom:30px"
        layout="total, prev, pager, next, jumper"
        :total="total"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      />
    </el-col>
  </div>
</template>
<script>
export default {
  data() {
    return {
      currentPage: 1, // 初始页
      pagesize: 10, // 当前页面内的列表行数
      pageCount: 1,
      pageNum: 1, // 页数
      total: 5,
      dialogFormVisible: false,
      tableData: [
        {
          id: '1564322231',
          time: '2019-12-01 19:34',
          time2: '2019-12-02 10:00',
          couent: '钢琴辅导',
          long: '2小时',
          user: '赵先生',
          phone: '13199451349',
          area: '浙江省杭州市下城区下沙大都会风情苑8幢6单元902室',
          goodType: '100元/时',
          money: '200元',
          state: '已完成',
          user2: '王洁'
        },
        {
          id: '1564322231',
          time: '2019-12-01 19:34',
          time2: '2019-12-02 10:00',
          long: '1.5小时',
          user: '黄女士',
          couent: '英语辅导',
          phone: '13199451349',
          area: '浙江省杭州市下城区下沙大都会风情苑8幢4单元502室',
          goodType: '100元/时',
          money: '150元',
          state: '已完成',
          user2: '刘玉明'
        },
        {
          id: '1564322231',
          time: '2019-12-01 19:34',
          time2: '2019-12-02 10:00',
          long: '3小时',
          user: '刘女士',
          phone: '13199451349',
          couent: '数学辅导',
          area: '浙江省杭州市下城区下沙大都会风情苑11幢1单元101室',
          goodType: '60元/时',
          money: '180元',
          state: '已接单',
          user2: '赵志'
        },
        {
          id: '1564322231',
          time: '2019-12-01 19:34',
          time2: '2019-12-02 10:00',
          long: '1小时',
          user: '黄先生',
          phone: '13199451349',
          couent: '辅导吉他',
          area: '浙江省杭州市下城区下沙大都会风情苑9幢4单元201室',
          goodType: '60元/时',
          money: '60元',
          state: '已完成',
          user2: '蓝宇'
        },
        {
          id: '1564322231',
          time: '2019-12-01 19:34',
          time2: '2019-12-02 10:00',
          long: '2小时',
          user: '刘女士',
          phone: '13199451349',
          couent: '辅导小提琴',
          area: '浙江省杭州市下城区下沙大都会风情苑7幢9单元702室',
          goodType: '80元/时',
          money: '160元',
          state: '待接单',
          user2: '胡东'
        }
      ]
    }
  },
  mounted() {},
  methods: {
    // 当前页
    handleSizeChange: function(pagesize) {
      this.pagesize = pagesize
    },
    // 换页：更新列表数据
    handleCurrentChange: function(currentPage) {
      this.currentPage = currentPage
    }
  }
}
</script>
<style lang="scss" scoped>
.hourly {
  margin-top: 55px;
}
</style>
